<template>
<v-app class="bgcolor" style="background:#fff;">
      <v-progress-linear
      indeterminate
      color="green"
      v-show="$store.state.progress"
    ></v-progress-linear>
    <v-snackbar
      v-model="$store.state.alert.show"
	  top
    >
      {{ $store.state.alert.text }}
      <v-btn
        color="pink"
        text
		    icon
        @click="$store.state.alert.show = false"
      >
        <v-icon>
         {{ $store.state.alert.icon }} 
        </v-icon>
      </v-btn>
    </v-snackbar>
  <div id="app" class="bgcolor" style="background:#fff;height:100%;">
  <router-view>
  </router-view>
  </div>
  <!--
    <v-footer :color="$store.state.color.bgcolor">
      <div class="flex-grow-1"></div>
      <div>&copy; {{ new Date().getFullYear() }}</div>
    </v-footer>
    -->
 </v-app>
</template>

<script>

import SnackBar from '@/components/SnackBar'
// import wx from 'weixin-js-sdk'
import { wxjssdk } from './api/api'
export default {
  data: () => ({
    bgcolor:"#fff"
    //
	}),
	methods:{
		home:()=>{

		},
		favorite:()=>{

		},
		person:function(){
			//window.location.href = "/user/center"
			this.$router.push({path:"/user/center"})
		},

	},
  components: {
    SnackBar
  },
  created: function(){
    var authexp = this.$cookies.get('authexp')
    document.title = '利佳健康服务'
    this.bgcolor = this.$store.state.color.bgcolor
    const wecatConfig = (res) => {
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: res.data.app_id, // 必填，公众号的唯一标识
            timestamp: res.data.timestamp, // 必填，生成签名的时间戳
            nonceStr: res.data.nonce_str, // 必填，生成签名的随机串
            signature: res.data.signature,// 必填，签名
            jsApiList: [
                "updateAppMessageShareData",
                "updateTimelineShareData",
                "onMenuShareWeibo",
                "onMenuShareQZone",
                "startRecord",
                "stopRecord",
                "onVoiceRecordEnd",
                "playVoice",
                "pauseVoice",
                "stopVoice",
                "onVoicePlayEnd",
                "uploadVoice",
                "downloadVoice",
                "chooseImage",
                "previewImage",
                "uploadImage",
                "downloadImage",
                "translateVoice",
                "getNetworkType",
                "openLocation",
                "getLocation",
                "hideOptionMenu",
                "showOptionMenu",
                "hideMenuItems",
                "showMenuItems",
                "hideAllNonBaseMenuItem",
                "showAllNonBaseMenuItem",
                "closeWindow",
                "scanQRCode",
                "chooseWXPay",
                "openProductSpecificView",
                "addCard",
                "chooseCard",
                "openCard",
            ] // 必填，需要使用的JS接口列表
        });
        wx.ready(function(){
            // 微信配置就绪后
            console.log("wxsdk is ok")
            var shareP = { 
                title: '利佳健康服务', // 利佳健康服务
                desc: '育苗/美容/体检/医疗咨询/核保', // 利佳健康服务
                link: 'https://iuu.pub/', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: '', // 分享图标
                success: function () {
                  // 设置成功
                }
            }
            wx.updateAppMessageShareData(shareP)
            wx.updateTimelineShareData(shareP)
        })
    }
    wxjssdk() // 获取微信JSSDK
    .then((resp)=>{
        var res = resp.data
        wecatConfig(res)
    })
  }
};
</script>
<style>
.bgcolor {
  background-color: "#fff";
	background:#fff;
}
</style>